package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.PublicReviewManage;
import com.ruoyi.system.service.PublicReviewManageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 大众评审管理表(PublicReviewManage)表控制层
 *
 * @author makejava
 * @since 2021-08-27 14:57:04
 */
@RestController
@RequestMapping("publicReviewManage")
public class PublicReviewManageController {
    /**
     * 服务对象
     */
    @Resource
    private PublicReviewManageService publicReviewManageService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public PublicReviewManage selectOne(Integer id) {
        return this.publicReviewManageService.queryById(id);
    }

    @PostMapping("insertPublicReview")
    public AjaxResult insertPublicReview(PublicReviewManage publicReviewManage) {
        try {
            this.publicReviewManageService.insert(publicReviewManage);
            return AjaxResult.success();
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error(e.getMessage());
        }
    }
}
